Skip to content

Fix VPC network offerings listing in isolated network creation form#12645

Open
erikbocks wants to merge 1 commit intoapache:4.20from
scclouds:fix-vpc-network-offerings-listing
Open

Fix VPC network offerings listing in isolated network creation form#12645
erikbocks wants to merge 1 commit intoapache:4.20from
scclouds:fix-vpc-network-offerings-listing

Conversation

@erikbocks
Copy link
Copy Markdown
Collaborator

Description

Currently, when creating a new isolated network, it is possible to assign it as a VPC tier. The VPC assignment field is shown only when a VPC network offering is selected. However, it was noticed that VPC network offerings are listed only if the current user has at least one VPC. Otherwise, VPC network offering were not listed and it was necessary to access another account that has a VPC or create a dummy VPC.

Changes were made,to list offerings based on the form selected account instead of the current user. Besides that, an warning was added below the network offerings field informing that VPC network offerings will be shown only if the selected account has at least one VPC.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

Warning message:

image
No VPC user offerings image

No warning shown for account that has a VPC:

image
VPC network offerings listed for a account that has a VPC image

How Has This Been Tested?

Logged in with the admin account, I created a VPC to the radm account. Then, I accessed the isolated network creation form and validated that the VPC offerings were not shown (because the current account did not had a VPC). Then, I applied the PR changes to my local environment.

With the changes applied, the isolated network form was accessed again, and it was possible to see the warning message. When the radm was selected in the form, the warning message was hidden and the VPC offerings were listed successfully.

The same tests were reproduced for projects.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.26%. Comparing base (8eb162c) to head (d1cda46).

Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #12645      +/-   ##
============================================
- Coverage     16.26%   16.26%   -0.01%     
  Complexity    13433    13433              
============================================
  Files          5665     5665              
  Lines        500530   500530              
  Branches      60787    60787              
============================================
- Hits          81411    81410       -1     
- Misses       410027   410028       +1     
  Partials       9092     9092              
Flag Coverage Δ
uitests 4.15% <ø> (ø)
unittests 17.11% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sureshanaparti
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 16842

@winterhazel
Copy link
Copy Markdown
Member

@erikbocks as this is a simple enhancement, could you target the next 4.20/4.22 minor?

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@erikbocks erikbocks force-pushed the fix-vpc-network-offerings-listing branch from 3075a64 to d1cda46 Compare April 14, 2026 19:15
@erikbocks erikbocks changed the base branch from main to 4.20 April 14, 2026 19:15
@erikbocks erikbocks requested review from winterhazel and removed request for Pearl1594, nvazquez, rp- and slavkap April 14, 2026 19:16
@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/12645 (QA-JID-911)

Copy link
Copy Markdown
Member

@winterhazel winterhazel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Tested in QA that the VPC offerings are now shown when the selected user has a VPC instead of the calling account.

VPC offerings shown when selecting a user that has VPCs image
VPC offerings hidden when selecting a user that does not have VPCs image

this.fetchNetworkOfferingData(true)
} else { // from guest network section
var params = {}
var params = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var params = {
const params = {

var vpcAvailable = this.arrayHasItems(listVPCs)
if (vpcAvailable === false) {
this.hasVPC = this.arrayHasItems(listVPCs)
if (this.hasVPC === false) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (this.hasVPC === false) {
if (!this.hasVPC) {

Comment thread ui/public/locales/en.json
"message.warn.filetype": "jpg, jpeg, png, bmp and svg are the only supported image formats.",
"message.warn.importing.instance.without.nic": "WARNING: This Instance is being imported without NICs and many Network resources will not be available. Consider creating a NIC via vCenter before importing or as soon as the Instance is imported.",
"message.warn.zone.mtu.update": "Please note that this limit won't affect pre-existing Network's MTU settings",
"message.warn.vpc.offerings": "VPC offerings will be shown only if the selected account has at least one VPC.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"message.warn.vpc.offerings": "VPC offerings will be shown only if the selected account has at least one VPC.",
"message.warn.vpc.offerings": "VPC offerings will only be shown if the selected account has at least one VPC.",

"message.vr.alert.upon.network.offering.creation.others": "Como nenhum dos servi\u00e7os obrigat\u00f3rios para cria\u00e7\u00e3o do VR (VPN, DHCP, DNS, Firewall, LB, UserData, SourceNat, StaticNat, PortForwarding) foram habilitados, o VR n\u00e3o ser\u00e1 criado e a oferta de computa\u00e7\u00e3o n\u00e3o ser\u00e1 usada.",
"message.warn.filetype": "jpg, jpeg, png, bmp e svg s\u00e3o os \u00fanicos formatos de imagem suportados",
"message.warn.importing.instance.without.nic": "AVISO: essa inst\u00e2ncia est\u00e1 sendo importada sem NICs e muitos recursos de rede n\u00e3o estar\u00e3o dispon\u00edveis. Considere criar uma NIC antes de importar via VCenter ou assim que a inst\u00e2ncia for importada.",
"message.warn.vpc.offerings": "Ofertas de VPC s\u00c3o exibidas somente caso a conta selecionada possua ao menos uma VPC.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"message.warn.vpc.offerings": "Ofertas de VPC s\u00c3o exibidas somente caso a conta selecionada possua ao menos uma VPC.",
"message.warn.vpc.offerings": "Ofertas de VPC somente ser\u00c3o exibidas caso a conta selecionada possua ao menos uma VPC.",

Comment on lines +534 to 537
if (this.hasVPC === false) {
this.fetchNetworkOfferingData(false)
} else {
this.fetchNetworkOfferingData()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (this.hasVPC === false) {
this.fetchNetworkOfferingData(false)
} else {
this.fetchNetworkOfferingData()
this.fetchNetworkOfferingData(this.hasVPC)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erikbocks I did not dig in this code too deep, if these are not equivalente, you can just disregard this suggestion

Copy link
Copy Markdown
Contributor

@GaOrtiga GaOrtiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from some minor nits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants